/*
 *uni-app自带一个webpack loader钩子文件pages.js，在项目根目录下建立pages.js（与pages.json同级）即可生效
 * pages.js要求CommonJS规范，直接通过module.exports输出一个钩子函数。
*/
const chokidar = require('chokidar')
const fs = require('fs');
let path = require("path");
const {setSubPages,watchPages} = require('./initPages.js') 
// const router =  setSubPages()
module.exports = abc
async function abc(pagesJson, loader){
console.log('pages......')
const res = await setSubPages(chokidar,fs,path)
console.log(res,'res......')
	let pages = {
			"pages":res ,
			"globalStyle": {
				"navigationBarTextStyle": "black",
				"navigationBarTitleText": "uni-app",
				"navigationBarBackgroundColor": "#F8F8F8",
				"backgroundColor": "#F8F8F8"
			},
			"tabBar": {
				"color": "#7A7E83",
				"selectedColor": "#007AFF",
				"borderStyle": "black",
				"backgroundColor": "#F8F8F8",
				"list": [
					{
						"pagePath": "pages/index/index",
						"iconPath": "./static/nav-logo/index.png",
						"selectedIconPath": "./static/nav-logo/index-active.png",
						"text": "选品库"
					},
					{
						"pagePath": "pages/seo/index",
						"iconPath": "./static/nav-logo/seo.png",
						"selectedIconPath": "./static/nav-logo/seo-active.png",
						"text": "搜索"
					}, 
					{
						"pagePath": "pages/recommend/index",
						"iconPath": "./static/nav-logo/recommend.png",
						"selectedIconPath": "./static/nav-logo/recommend-active.png",
						"text": "推荐专题"
					},			
					{
						"pagePath": "pages/my/index",
						"iconPath": "./static/nav-logo/mine.png",
						"selectedIconPath": "./static/nav-logo/mine-active.png",
						"text": "我的66"
					}
				]
			}
		}
	
	
		//此钩子函数必须返回一个json对象
		return pages
}


abc()

